<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#49b1f5">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon-180x180-yaowan.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-yaowan.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-yaowan.png">
  <link rel="mask-icon" href="/images/logo-yaowan.svg" color="#49b1f5">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css">
  <script src="//cdn.jsdelivr.net/npm/pace-js@1/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"zhouyuqian.com","root":"/","scheme":"Mist","version":"7.7.2","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":"default","style":"flat"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":true,"color":"#49b1f5","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":"ture"},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="数字信号处理Matlab实习报告">
<meta property="og:type" content="article">
<meta property="og:title" content="Matlab应用实践">
<meta property="og:url" content="https://zhouyuqian.com/2019/01/11/Matlab%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5/index.html">
<meta property="og:site_name" content="Fitz&#39;s Blog - 快乐学习每一天">
<meta property="og:description" content="数字信号处理Matlab实习报告">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-01-10T16:23:46.000Z">
<meta property="article:modified_time" content="2019-01-22T07:45:01.000Z">
<meta property="article:author" content="Fitz">
<meta property="article:tag" content="Matlab">
<meta property="article:tag" content="数字信号处理">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://zhouyuqian.com/2019/01/11/Matlab%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true
  };
</script>

  <title>Matlab应用实践 | Fitz's Blog - 快乐学习每一天</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Fitz's Blog - 快乐学习每一天</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-ariang">

    <a href="/AriaNg/" rel="section"><i class="fa fa-fw fa-cloud-download"></i>AriaNg</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/Starrynightzyq" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://zhouyuqian.com/2019/01/11/Matlab%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="Fitz">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Fitz's Blog - 快乐学习每一天">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Matlab应用实践
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-01-11 00:23:46" itemprop="dateCreated datePublished" datetime="2019-01-11T00:23:46+08:00">2019-01-11</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2019-01-22 15:45:01" itemprop="dateModified" datetime="2019-01-22T15:45:01+08:00">2019-01-22</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E8%AF%BE%E8%AE%BE/" itemprop="url" rel="index"><span itemprop="name">课设</span></a>
                </span>
            </span>

          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.9k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>
            <div class="post-description">数字信号处理Matlab实习报告</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="实验一-基础练习">实验一 基础练习</h1>
<h2 id="练习1-基本操作和简单语句输入">练习1 基本操作和简单语句输入</h2>
<ol type="1">
<li><p>用函数sym定义符号矩阵：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; sym_matrix = sym(<span class="string">&#x27;[a b c;Jack Help_Me NO_WAY]&#x27;</span>)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sym_matrix =</span><br><span class="line"> </span><br><span class="line">[    a,       b,      c]</span><br><span class="line">[ Jack, Help_Me, NO_WAY]</span><br></pre></td></tr></table></figure></li>
<li><p>用函数syms定义符号矩阵</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; syms a b c ;</span><br><span class="line">&gt;&gt; M1 = sym(<span class="string">&#x27;Classical&#x27;</span>);</span><br><span class="line">&gt;&gt; M2 = sym(<span class="string">&#x27; Jazz&#x27;</span>);</span><br><span class="line">&gt;&gt; M3 = sym(<span class="string">&#x27;Blues&#x27;</span>);</span><br><span class="line">&gt;&gt; A = [a b c;M1,M2,M3;sym([<span class="number">2</span> <span class="number">3</span> <span class="number">5</span>])]</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">A =</span><br><span class="line"> </span><br><span class="line">[         a,    b,     c]</span><br><span class="line">[ Classical, Jazz, Blues]</span><br><span class="line">[         <span class="number">2</span>,    <span class="number">3</span>,     <span class="number">5</span>]</span><br></pre></td></tr></table></figure></li>
<li><p>输入<code>A=[7 1 5;2 5 6;3 1 5],B=[1 1 1; 2 2 2; 3 3 3]</code>，在命令窗口中执行下列表达式，掌握其含义：<code>A(2, 3) A(:,2) A(3,:) A(:,1:2:3) A(:,3).*B(:,2) A(:,3)*B(2,:) A*B A.*B A^2 A.^2 B/A B./A</code></p>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A=[<span class="number">7</span> <span class="number">1</span> <span class="number">5</span>;<span class="number">2</span> <span class="number">5</span> <span class="number">6</span>;<span class="number">3</span> <span class="number">1</span> <span class="number">5</span>],B=[<span class="number">1</span> <span class="number">1</span> <span class="number">1</span>; <span class="number">2</span> <span class="number">2</span> <span class="number">2</span>; <span class="number">3</span> <span class="number">3</span> <span class="number">3</span>]</span><br><span class="line"></span><br><span class="line">A =</span><br><span class="line"></span><br><span class="line">     <span class="number">7</span>     <span class="number">1</span>     <span class="number">5</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">5</span>     <span class="number">6</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">1</span>     <span class="number">5</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">B =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span>     <span class="number">1</span>     <span class="number">1</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">2</span>     <span class="number">2</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">3</span>     <span class="number">3</span></span><br></pre></td></tr></table></figure>
<p><code>A(2,3)</code>——输出矩阵A第二行第三列的值</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(<span class="number">2</span>, <span class="number">3</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">6</span></span><br></pre></td></tr></table></figure>
<p><code>A(:,2)</code>——输出矩阵A第二列的所有值</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(:,<span class="number">2</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span></span><br><span class="line">     <span class="number">5</span></span><br><span class="line">     <span class="number">1</span></span><br></pre></td></tr></table></figure>
<p><code>A(3,:)</code>——输出矩阵A第三行的所有值</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(<span class="number">3</span>,:)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">3</span>     <span class="number">1</span>     <span class="number">5</span></span><br></pre></td></tr></table></figure>
<p><code>A(:,1:2:3)</code>—— 输出矩阵A的第一列和第三列的值</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(:,<span class="number">1</span>:<span class="number">2</span>:<span class="number">3</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">7</span>     <span class="number">5</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">6</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">5</span></span><br></pre></td></tr></table></figure>
<p><code>A(:,3).*B(:,2)</code>——输出矩阵A的第三列与矩阵B的第二列的乘积</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(:,<span class="number">3</span>).*B(:,<span class="number">2</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">5</span></span><br><span class="line">    <span class="number">12</span></span><br><span class="line">    <span class="number">15</span></span><br></pre></td></tr></table></figure>
<p><code>A(:,3).*B(2,:)</code>——输出矩阵A的第三列与矩阵B的第二行的乘积</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A(:,<span class="number">3</span>).*B(<span class="number">2</span>,:)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">10</span>    <span class="number">10</span>    <span class="number">10</span></span><br><span class="line">    <span class="number">12</span>    <span class="number">12</span>    <span class="number">12</span></span><br><span class="line">    <span class="number">10</span>    <span class="number">10</span>    <span class="number">10</span></span><br></pre></td></tr></table></figure>
<p><code>A*B</code>——将矩阵A与矩阵B进行矩阵乘法运算</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A*B</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">24</span>    <span class="number">24</span>    <span class="number">24</span></span><br><span class="line">    <span class="number">30</span>    <span class="number">30</span>    <span class="number">30</span></span><br><span class="line">    <span class="number">20</span>    <span class="number">20</span>    <span class="number">20</span></span><br></pre></td></tr></table></figure>
<p><code>A.*B</code>——将矩阵A与矩阵B中相同位置的元素相乘</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A.*B</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">7</span>     <span class="number">1</span>     <span class="number">5</span></span><br><span class="line">     <span class="number">4</span>    <span class="number">10</span>    <span class="number">12</span></span><br><span class="line">     <span class="number">9</span>     <span class="number">3</span>    <span class="number">15</span></span><br></pre></td></tr></table></figure>
<p><code>A^2</code>——将矩阵A与矩阵A进行矩阵乘法运算</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A^<span class="number">2</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">66</span>    <span class="number">17</span>    <span class="number">66</span></span><br><span class="line">    <span class="number">42</span>    <span class="number">33</span>    <span class="number">70</span></span><br><span class="line">    <span class="number">38</span>    <span class="number">13</span>    <span class="number">46</span></span><br></pre></td></tr></table></figure>
<p><code>A.^2</code>——将矩阵A与矩阵A相对应位置的元素相乘</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A.^<span class="number">2</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">49</span>     <span class="number">1</span>    <span class="number">25</span></span><br><span class="line">     <span class="number">4</span>    <span class="number">25</span>    <span class="number">36</span></span><br><span class="line">     <span class="number">9</span>     <span class="number">1</span>    <span class="number">25</span></span><br></pre></td></tr></table></figure>
<p><code>B/A</code>——矩阵B乘矩阵A的逆</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; B/A</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">0.1842</span>    <span class="number">0.2105</span>   <span class="number">-0.2368</span></span><br><span class="line">    <span class="number">0.3684</span>    <span class="number">0.4211</span>   <span class="number">-0.4737</span></span><br><span class="line">    <span class="number">0.5526</span>    <span class="number">0.6316</span>   <span class="number">-0.7105</span></span><br></pre></td></tr></table></figure>
<p><code>B./A</code>——矩阵B与矩阵A相对应的元素相除</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; B./A</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">0.1429</span>    <span class="number">1.0000</span>    <span class="number">0.2000</span></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">0.4000</span>    <span class="number">0.3333</span></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">3.0000</span>    <span class="number">0.6000</span></span><br></pre></td></tr></table></figure></li>
<li><p>输入<code>C=1:2:20</code>，则<code>C(i)</code>表示什么？其中<code>i=1,2,3,…,10</code>；</p>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; C=<span class="number">1</span>:<span class="number">2</span>:<span class="number">20</span></span><br><span class="line"></span><br><span class="line">C =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span>     <span class="number">3</span>     <span class="number">5</span>     <span class="number">7</span>     <span class="number">9</span>    <span class="number">11</span>    <span class="number">13</span>    <span class="number">15</span>    <span class="number">17</span>    <span class="number">19</span></span><br></pre></td></tr></table></figure>
<p><code>C(i)</code>表示第i位的数据</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; C(<span class="number">1</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span></span><br><span class="line"></span><br><span class="line">&gt;&gt; C(<span class="number">5</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">9</span></span><br></pre></td></tr></table></figure></li>
<li><p>查找已创建变量的信息，删除无用的变量</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&gt;&gt; A</span><br><span class="line"></span><br><span class="line">A =</span><br><span class="line"></span><br><span class="line">     <span class="number">7</span>     <span class="number">1</span>     <span class="number">5</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">5</span>     <span class="number">6</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">1</span>     <span class="number">5</span></span><br><span class="line"></span><br><span class="line">&gt;&gt; clear A</span><br><span class="line">&gt;&gt; A</span><br><span class="line">未定义函数或变量 <span class="string">&#x27;A&#x27;</span>。</span><br></pre></td></tr></table></figure>
<h2 id="练习2-编程">练习2 编程</h2></li>
<li><p>编写程序,计算1+3+5+7+…+(2n+1)的值(用input 语句输入n 值)</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">clear</span><br><span class="line">clc</span><br><span class="line">n = input(<span class="string">&#x27;input n = &#x27;</span>);</span><br><span class="line">sum = <span class="number">1</span>;</span><br><span class="line"><span class="keyword">for</span> <span class="built_in">i</span> = <span class="number">1</span>:n</span><br><span class="line">    sum = sum + (<span class="number">2</span>*<span class="built_in">i</span>+<span class="number">1</span>);</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"><span class="built_in">disp</span>([<span class="string">&#x27;sum = &#x27;</span> num2str(sum)]);</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">input n = <span class="number">10</span></span><br><span class="line">sum = <span class="number">121</span></span><br></pre></td></tr></table></figure></li>
<li><p>编写分段函数$y = {</p>
<span class="math display">\[\begin{array}{ll}
x &amp; \textrm{$0 \leq x&lt;1$}\\
2-x &amp; \textrm{$1 \leq x \leq 2$}\\
0 &amp; \textrm{其他}
\end{array}\]</span>
<p>.<span class="math inline">\(的函数文件，存放于文件ff.m中，计算出\)</span>f(-3)<span class="math inline">\(、\)</span>f()<span class="math inline">\(、\)</span>f()$的值。</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">x = input(<span class="string">&#x27;x = &#x27;</span>);</span><br><span class="line"><span class="keyword">if</span>(x&gt;=<span class="number">0</span> &amp;&amp; x&lt;<span class="number">1</span>)</span><br><span class="line">    fx = x;</span><br><span class="line"><span class="keyword">else</span> <span class="keyword">if</span>(x &gt;= <span class="number">1</span> &amp;&amp; x &lt;= <span class="number">2</span>)</span><br><span class="line">        fx = <span class="number">2</span> - x;</span><br><span class="line">    <span class="keyword">else</span></span><br><span class="line">        fx = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"><span class="built_in">disp</span>([<span class="string">&#x27;f(x) = &#x27;</span>, num2str(fx)]);</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">x = <span class="number">0.5</span></span><br><span class="line">f(x) = <span class="number">0.5</span></span><br><span class="line">x = <span class="number">1.5</span></span><br><span class="line">f(x) = <span class="number">0.5</span></span><br><span class="line">x = <span class="number">-2</span></span><br><span class="line">f(x) = <span class="number">0</span></span><br><span class="line">x = <span class="number">3</span></span><br><span class="line">f(x) = <span class="number">0</span></span><br></pre></td></tr></table></figure>
<h2 id="练习3-矩阵计算">练习3 矩阵计算</h2></li>
<li><p>加、减运算</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">clear</span><br><span class="line">clc</span><br><span class="line">A=[<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>; <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>; <span class="number">1</span>, <span class="number">3</span>, <span class="number">6</span>];</span><br><span class="line">B=[<span class="number">8</span>, <span class="number">1</span>, <span class="number">6</span>; <span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>; <span class="number">4</span>, <span class="number">9</span>, <span class="number">2</span>];</span><br><span class="line">X=A+B;</span><br><span class="line">Y=A-B;</span><br><span class="line"><span class="built_in">disp</span>([<span class="string">&#x27;A+B = &#x27;</span>]);</span><br><span class="line"><span class="built_in">disp</span>(X);</span><br><span class="line"><span class="built_in">disp</span>([<span class="string">&#x27;A-B = &#x27;</span>]);</span><br><span class="line"><span class="built_in">disp</span>(Y);</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">A+B = </span><br><span class="line">     <span class="number">9</span>     <span class="number">2</span>     <span class="number">7</span></span><br><span class="line">     <span class="number">4</span>     <span class="number">7</span>    <span class="number">10</span></span><br><span class="line">     <span class="number">5</span>    <span class="number">12</span>     <span class="number">8</span></span><br><span class="line"></span><br><span class="line">A-B = </span><br><span class="line">    <span class="number">-7</span>     <span class="number">0</span>    <span class="number">-5</span></span><br><span class="line">    <span class="number">-2</span>    <span class="number">-3</span>    <span class="number">-4</span></span><br><span class="line">    <span class="number">-3</span>    <span class="number">-6</span>     <span class="number">4</span></span><br></pre></td></tr></table></figure></li>
<li><p>乘法</p>
<ol type="1">
<li><p>两个矩阵相乘</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">X= [<span class="number">2</span> <span class="number">3</span> <span class="number">4</span> <span class="number">5</span> </span><br><span class="line">    <span class="number">1</span> <span class="number">2</span> <span class="number">2</span> <span class="number">1</span>];</span><br><span class="line">Y=[<span class="number">0</span> <span class="number">1</span> <span class="number">1</span> </span><br><span class="line">   <span class="number">1</span> <span class="number">1</span> <span class="number">0</span> </span><br><span class="line">   <span class="number">0</span> <span class="number">0</span> <span class="number">1</span> </span><br><span class="line">   <span class="number">1</span> <span class="number">0</span> <span class="number">0</span>];</span><br><span class="line">Z = X*Y;</span><br><span class="line"><span class="built_in">disp</span>([<span class="string">&#x27;Z = &#x27;</span>]);</span><br><span class="line"><span class="built_in">disp</span>(Z);</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Z = </span><br><span class="line">     <span class="number">8</span>     <span class="number">5</span>     <span class="number">6</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">3</span>     <span class="number">3</span></span><br></pre></td></tr></table></figure></li>
<li><p>矩阵的数乘</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">a = <span class="number">2</span>*X;</span><br><span class="line"><span class="built_in">disp</span>(<span class="string">&#x27;a = &#x27;</span>);</span><br><span class="line"><span class="built_in">disp</span>(a);</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">a = </span><br><span class="line">     <span class="number">4</span>     <span class="number">6</span>     <span class="number">8</span>    <span class="number">10</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">4</span>     <span class="number">4</span>     <span class="number">2</span></span><br></pre></td></tr></table></figure></li>
<li><p>向量的点乘（内积）</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">X=[<span class="number">-1</span> <span class="number">0</span> <span class="number">2</span>]; Y=[<span class="number">-2</span> <span class="number">-1</span> <span class="number">1</span>];</span><br><span class="line">Z=<span class="built_in">dot</span>(X, Y)</span><br><span class="line"><span class="comment">% 或者</span></span><br><span class="line">sum(X.*Y)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Z =</span><br><span class="line"></span><br><span class="line">     <span class="number">4</span></span><br></pre></td></tr></table></figure>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">4</span></span><br></pre></td></tr></table></figure></li>
<li><p>向量叉乘</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">a=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>];</span><br><span class="line">b=[<span class="number">4</span> <span class="number">5</span> <span class="number">6</span>];</span><br><span class="line">c=<span class="built_in">cross</span>(a,b)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">c =</span><br><span class="line"></span><br><span class="line">    <span class="number">-3</span>     <span class="number">6</span>    <span class="number">-3</span></span><br></pre></td></tr></table></figure></li>
<li><p>混合积</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">a=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>]; b=[<span class="number">4</span> <span class="number">5</span> <span class="number">6</span>]; c=[<span class="number">-3</span> <span class="number">6</span> <span class="number">-3</span>];</span><br><span class="line">x=<span class="built_in">dot</span>(a, <span class="built_in">cross</span>(b, c))</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">x =</span><br><span class="line"></span><br><span class="line">    <span class="number">54</span></span><br></pre></td></tr></table></figure></li>
</ol></li>
<li><p>矩阵的除法</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">a=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">4</span> <span class="number">2</span> <span class="number">6</span>; <span class="number">7</span> <span class="number">4</span> <span class="number">9</span>];</span><br><span class="line">b=[<span class="number">4</span>; <span class="number">1</span>; <span class="number">2</span>];</span><br><span class="line">x=a\b</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">x =</span><br><span class="line"></span><br><span class="line">   <span class="number">-1.5000</span></span><br><span class="line">    <span class="number">2.0000</span></span><br><span class="line">    <span class="number">0.5000</span></span><br></pre></td></tr></table></figure></li>
<li><p>矩阵乘方</p>
<ol type="1">
<li><p>A为方阵，p 为大于0 的整数时，A^P 表示A 的P 次方，即A 自乘P 次；p 为小于0 的整数时，A^P 表示A-1 的P 次方。</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">4</span> <span class="number">2</span> <span class="number">6</span>; <span class="number">7</span> <span class="number">4</span> <span class="number">9</span>];</span><br><span class="line">A^<span class="number">2</span></span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">30</span>    <span class="number">18</span>    <span class="number">42</span></span><br><span class="line">    <span class="number">54</span>    <span class="number">36</span>    <span class="number">78</span></span><br><span class="line">    <span class="number">86</span>    <span class="number">58</span>   <span class="number">126</span></span><br></pre></td></tr></table></figure></li>
<li><p>A 为方阵，p 为非整数时，则其中V 为A 的特征向量，为特征值矩阵。</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">4</span> <span class="number">2</span> <span class="number">6</span>; <span class="number">7</span> <span class="number">4</span> <span class="number">9</span>];</span><br><span class="line">A^<span class="number">0.5</span></span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">  <span class="number">-0.6094</span> - <span class="number">0.0000</span><span class="built_in">i</span>   <span class="number">2.4744</span> + <span class="number">0.0000</span><span class="built_in">i</span>  <span class="number">-0.1031</span> - <span class="number">0.0000</span><span class="built_in">i</span></span><br><span class="line">   <span class="number">0.3712</span> - <span class="number">0.0000</span><span class="built_in">i</span>   <span class="number">1.3908</span> + <span class="number">0.0000</span><span class="built_in">i</span>   <span class="number">1.3197</span> - <span class="number">0.0000</span><span class="built_in">i</span></span><br><span class="line">   <span class="number">2.8112</span> - <span class="number">0.0000</span><span class="built_in">i</span>  <span class="number">-0.6461</span> + <span class="number">0.0000</span><span class="built_in">i</span>   <span class="number">3.1847</span> - <span class="number">0.0000</span><span class="built_in">i</span></span><br></pre></td></tr></table></figure></li>
</ol></li>
<li><p>矩阵的转置</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">4</span> <span class="number">2</span> <span class="number">6</span>; <span class="number">7</span> <span class="number">4</span> <span class="number">9</span>];</span><br><span class="line">A&#x27;</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span>     <span class="number">4</span>     <span class="number">7</span></span><br><span class="line">     <span class="number">2</span>     <span class="number">2</span>     <span class="number">4</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">6</span>     <span class="number">9</span></span><br></pre></td></tr></table></figure></li>
<li><p>矩阵的逆矩阵</p>
<ol type="1">
<li><p>方法一</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">2</span> <span class="number">2</span> <span class="number">1</span>; <span class="number">3</span> <span class="number">4</span> <span class="number">3</span>];</span><br><span class="line">inv(A)</span><br><span class="line"><span class="comment">%或 A^(-1)</span></span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">3.0000</span>   <span class="number">-2.0000</span></span><br><span class="line">   <span class="number">-1.5000</span>   <span class="number">-3.0000</span>    <span class="number">2.5000</span></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">1.0000</span>   <span class="number">-1.0000</span></span><br></pre></td></tr></table></figure></li>
<li><p>方法二</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">B=[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>; <span class="number">2</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>; <span class="number">3</span>, <span class="number">4</span>, <span class="number">3</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>];</span><br><span class="line">C=rref(B); <span class="comment">%化行最简形</span></span><br><span class="line">X=C(:, <span class="number">4</span>:<span class="number">6</span>)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">X =</span><br><span class="line"></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">3.0000</span>   <span class="number">-2.0000</span></span><br><span class="line">   <span class="number">-1.5000</span>   <span class="number">-3.0000</span>    <span class="number">2.5000</span></span><br><span class="line">    <span class="number">1.0000</span>    <span class="number">1.0000</span>   <span class="number">-1.0000</span></span><br></pre></td></tr></table></figure></li>
</ol></li>
<li><p>方阵的行列式</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">2</span> <span class="number">3</span>; <span class="number">2</span> <span class="number">2</span> <span class="number">1</span>; <span class="number">3</span> <span class="number">4</span> <span class="number">3</span>];</span><br><span class="line">D=det(A)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">D =</span><br><span class="line"></span><br><span class="line">    <span class="number">2.0000</span></span><br></pre></td></tr></table></figure></li>
<li><p>符号矩阵的四则运算</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">A=sym(<span class="string">&#x27;[1/x,1/(x+1);1/(x+2),1/(x+3)]&#x27;</span>);</span><br><span class="line">B=sym(<span class="string">&#x27;[x,1;x+2,0]&#x27;</span>);</span><br><span class="line">C=B-A</span><br><span class="line">D=A\B</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">C =</span><br><span class="line"> </span><br><span class="line">[           x - <span class="number">1</span>/x, <span class="number">1</span> - <span class="number">1</span>/(x + <span class="number">1</span>)]</span><br><span class="line">[ x - <span class="number">1</span>/(x + <span class="number">2</span>) + <span class="number">2</span>,    <span class="number">-1</span>/(x + <span class="number">3</span>)]</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">D =</span><br><span class="line"> </span><br><span class="line">[ -x*(<span class="number">2</span>*x^<span class="number">2</span> + <span class="number">7</span>*x + <span class="number">6</span>),  (x*(x^<span class="number">2</span> + <span class="number">3</span>*x + <span class="number">2</span>))/<span class="number">2</span>]</span><br><span class="line">[  <span class="number">2</span>*(x + <span class="number">1</span>)^<span class="number">2</span>*(x + <span class="number">3</span>), -(x*(x + <span class="number">1</span>)*(x + <span class="number">3</span>))/<span class="number">2</span>]</span><br></pre></td></tr></table></figure></li>
<li><p>符号矩阵的简化</p>
<ol type="1">
<li><p>因式分解</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">syms x;</span><br><span class="line"><span class="built_in">factor</span>(x^<span class="number">9</span><span class="number">-1</span>)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ans</span> =</span><br><span class="line"> </span><br><span class="line">[ x - <span class="number">1</span>, x^<span class="number">2</span> + x + <span class="number">1</span>, x^<span class="number">6</span> + x^<span class="number">3</span> + <span class="number">1</span>]</span><br></pre></td></tr></table></figure></li>
<li><p>符号矩阵的展开</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">syms x y;</span><br><span class="line">p=expand((x+<span class="number">1</span>)^<span class="number">3</span>)</span><br><span class="line">q=expand(<span class="built_in">sin</span>(x+y))</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">p =</span><br><span class="line"> </span><br><span class="line">x^<span class="number">3</span> + <span class="number">3</span>*x^<span class="number">2</span> + <span class="number">3</span>*x + <span class="number">1</span></span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">q =</span><br><span class="line"> </span><br><span class="line"><span class="built_in">cos</span>(x)*<span class="built_in">sin</span>(y) + <span class="built_in">cos</span>(y)*<span class="built_in">sin</span>(x)</span><br></pre></td></tr></table></figure></li>
<li><p>同类式合并</p>
<p><code>Collect(s,v)</code>将<code>s</code>中的变量<code>v</code>的同幂项系数合并。</p></li>
<li><p>符号简化</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Simple(s);</span><br><span class="line">Pretty(s);</span><br></pre></td></tr></table></figure>
<h2 id="练习4-秩与线性相关性">练习4 秩与线性相关性</h2></li>
</ol></li>
<li><p>矩阵和向量组的秩以及向量组的线性相关性</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">-2</span> <span class="number">2</span> <span class="number">3</span>;<span class="number">-2</span> <span class="number">4</span> <span class="number">-1</span> <span class="number">3</span>;<span class="number">-1</span> <span class="number">2</span> <span class="number">0</span> <span class="number">3</span>;<span class="number">0</span> <span class="number">6</span> <span class="number">2</span> <span class="number">3</span>;<span class="number">2</span> <span class="number">-6</span> <span class="number">3</span> <span class="number">4</span>];</span><br><span class="line">B=rank(A)</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">B =</span><br><span class="line"></span><br><span class="line">     <span class="number">3</span></span><br></pre></td></tr></table></figure>
<p>由于秩为3 &lt; 向量个数，因此向量组线性相关。</p></li>
<li><p>向量组的最大无关组</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">a1=[<span class="number">1</span> <span class="number">-2</span> <span class="number">2</span> <span class="number">3</span>]&#x27;;</span><br><span class="line">a2=[<span class="number">-2</span> <span class="number">4</span> <span class="number">-1</span> <span class="number">3</span>]&#x27;;</span><br><span class="line">a3=[<span class="number">-1</span> <span class="number">2</span> <span class="number">0</span> <span class="number">3</span>]&#x27;;</span><br><span class="line">a4=[<span class="number">0</span> <span class="number">6</span> <span class="number">2</span> <span class="number">3</span>]&#x27;;</span><br><span class="line">a5=[<span class="number">2</span> <span class="number">-6</span> <span class="number">3</span> <span class="number">4</span>]&#x27;;</span><br><span class="line">A=[a1 a2 a3 a4 a5]</span><br><span class="line">format <span class="built_in">rat</span> <span class="comment">%以有理格式输出</span></span><br><span class="line">B=rref(A) <span class="comment">%求A的行最简形</span></span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">A =</span><br><span class="line"></span><br><span class="line">     <span class="number">1</span>    <span class="number">-2</span>    <span class="number">-1</span>     <span class="number">0</span>     <span class="number">2</span></span><br><span class="line">    <span class="number">-2</span>     <span class="number">4</span>     <span class="number">2</span>     <span class="number">6</span>    <span class="number">-6</span></span><br><span class="line">     <span class="number">2</span>    <span class="number">-1</span>     <span class="number">0</span>     <span class="number">2</span>     <span class="number">3</span></span><br><span class="line">     <span class="number">3</span>     <span class="number">3</span>     <span class="number">3</span>     <span class="number">3</span>     <span class="number">4</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">B =</span><br><span class="line"></span><br><span class="line">       <span class="number">1</span>              <span class="number">0</span>              <span class="number">1</span>/<span class="number">3</span>            <span class="number">0</span>             <span class="number">16</span>/<span class="number">9</span>     </span><br><span class="line">       <span class="number">0</span>              <span class="number">1</span>              <span class="number">2</span>/<span class="number">3</span>            <span class="number">0</span>             <span class="number">-1</span>/<span class="number">9</span>     </span><br><span class="line">       <span class="number">0</span>              <span class="number">0</span>              <span class="number">0</span>              <span class="number">1</span>             <span class="number">-1</span>/<span class="number">3</span>     </span><br><span class="line">       <span class="number">0</span>              <span class="number">0</span>              <span class="number">0</span>              <span class="number">0</span>              <span class="number">0</span>  </span><br></pre></td></tr></table></figure>
<h2 id="练习5-线性方程的组的求解">练习5 线性方程的组的求解</h2></li>
<li><p>利用矩阵除法求线性方程组的特解（或一个解） <span class="math display">\[
\left\{ \begin{array}{ll}
5x_1 + &amp; 6x_2 &amp; &amp; &amp; &amp; = &amp; 1\\
x_1  + &amp; 5x_2 + &amp; 6x_3   &amp;      &amp;    &amp; = &amp; 0\\
       &amp; x_2  + &amp; 5x_3 + &amp; 6x_4 &amp;    &amp; = &amp; 0\\
       &amp;        &amp; x_3  + &amp; 5x_4 + &amp; 6x_5 &amp; = &amp; 0\\
       &amp;        &amp;        &amp; x_4  + &amp; 5x_5 &amp; = &amp; 1
\end{array} \right.
\]</span></p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">5</span> <span class="number">6</span> <span class="number">0</span> <span class="number">0</span> <span class="number">0</span></span><br><span class="line">   <span class="number">1</span> <span class="number">5</span> <span class="number">6</span> <span class="number">0</span> <span class="number">0</span></span><br><span class="line">   <span class="number">0</span> <span class="number">1</span> <span class="number">5</span> <span class="number">6</span> <span class="number">0</span></span><br><span class="line">   <span class="number">0</span> <span class="number">0</span> <span class="number">1</span> <span class="number">5</span> <span class="number">6</span></span><br><span class="line">   <span class="number">0</span> <span class="number">0</span> <span class="number">0</span> <span class="number">1</span> <span class="number">5</span>];</span><br><span class="line">B=[<span class="number">1</span> <span class="number">0</span> <span class="number">0</span> <span class="number">0</span> <span class="number">1</span>]&#x27;;</span><br><span class="line">R_A=rank(A) <span class="comment">%求秩</span></span><br><span class="line">X=A\B <span class="comment">%求解</span></span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">R_A =</span><br><span class="line"></span><br><span class="line">       <span class="number">5</span>       </span><br><span class="line"></span><br><span class="line"></span><br><span class="line">X =</span><br><span class="line"></span><br><span class="line">    <span class="number">1507</span>/<span class="number">665</span>   </span><br><span class="line">    <span class="number">-229</span>/<span class="number">133</span>   </span><br><span class="line">      <span class="number">37</span>/<span class="number">35</span>    </span><br><span class="line">     <span class="number">-79</span>/<span class="number">133</span>   </span><br><span class="line">     <span class="number">212</span>/<span class="number">665</span>   </span><br></pre></td></tr></table></figure>
<p>这就是方程的解。</p></li>
<li><p>求方程组的解： <span class="math display">\[
\left\{ \begin{array}{ll}
x_1 +  &amp; x_2 -  &amp; 3x_3 - &amp; x_4  &amp; = &amp; 1\\
3x_1 - &amp; x_2 -  &amp; 3x_3 + &amp; 4x_4 &amp; = &amp; 4\\
x_1 +  &amp; 5x_2 - &amp; 9x_3 - &amp; 8x_4 &amp; = &amp; 0
\end{array} \right.
\]</span></p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">A=[<span class="number">1</span> <span class="number">1</span> <span class="number">-3</span> <span class="number">-1</span>;<span class="number">3</span> <span class="number">-1</span> <span class="number">-3</span> <span class="number">4</span>;<span class="number">1</span> <span class="number">5</span> <span class="number">-9</span> <span class="number">-8</span>];</span><br><span class="line">B=[<span class="number">1</span> <span class="number">4</span> <span class="number">0</span>]&#x27;;</span><br><span class="line">X=A\B</span><br></pre></td></tr></table></figure>
<p>结果：</p>
<figure class="highlight matlab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">X =</span><br><span class="line"></span><br><span class="line">       <span class="number">0</span>       </span><br><span class="line">       <span class="number">0</span>       </span><br><span class="line">      <span class="number">-8</span>/<span class="number">15</span>    </span><br><span class="line">       <span class="number">3</span>/<span class="number">5</span>    </span><br></pre></td></tr></table></figure>
<h1 id="实验二离散时间信号分析">实验二离散时间信号分析</h1></li>
</ol>

    </div>

    
    
    

    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------The end of this article&nbsp;<i class="fa fa-paw"></i>&nbsp;Thank you for your reading-------</div>
    
</div>
      
    </div>
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>Fitz
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://zhouyuqian.com/2019/01/11/Matlab%E5%BA%94%E7%94%A8%E5%AE%9E%E8%B7%B5/" title="Matlab应用实践">https://zhouyuqian.com/2019/01/11/Matlab应用实践/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Matlab/" <i class="fa fa-tag"></i> Matlab</a>
              <a href="/tags/%E6%95%B0%E5%AD%97%E4%BF%A1%E5%8F%B7%E5%A4%84%E7%90%86/" <i class="fa fa-tag"></i> 数字信号处理</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/12/24/HDB3-BPSK/" rel="prev" title="HDB3&BPSK">
      <i class="fa fa-chevron-left"></i> HDB3&BPSK
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/02/12/Xilinx-Petalinux-Learning/" rel="next" title="Xilinx-Petalinux-Learning">
      Xilinx-Petalinux-Learning <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%AE%9E%E9%AA%8C%E4%B8%80-%E5%9F%BA%E7%A1%80%E7%BB%83%E4%B9%A0"><span class="nav-number">1.</span> <span class="nav-text">实验一 基础练习</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%83%E4%B9%A01-%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C%E5%92%8C%E7%AE%80%E5%8D%95%E8%AF%AD%E5%8F%A5%E8%BE%93%E5%85%A5"><span class="nav-number">1.1.</span> <span class="nav-text">练习1 基本操作和简单语句输入</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%83%E4%B9%A02-%E7%BC%96%E7%A8%8B"><span class="nav-number">1.2.</span> <span class="nav-text">练习2 编程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%83%E4%B9%A03-%E7%9F%A9%E9%98%B5%E8%AE%A1%E7%AE%97"><span class="nav-number">1.3.</span> <span class="nav-text">练习3 矩阵计算</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%83%E4%B9%A04-%E7%A7%A9%E4%B8%8E%E7%BA%BF%E6%80%A7%E7%9B%B8%E5%85%B3%E6%80%A7"><span class="nav-number">1.4.</span> <span class="nav-text">练习4 秩与线性相关性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%83%E4%B9%A05-%E7%BA%BF%E6%80%A7%E6%96%B9%E7%A8%8B%E7%9A%84%E7%BB%84%E7%9A%84%E6%B1%82%E8%A7%A3"><span class="nav-number">1.5.</span> <span class="nav-text">练习5 线性方程的组的求解</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%AE%9E%E9%AA%8C%E4%BA%8C%E7%A6%BB%E6%95%A3%E6%97%B6%E9%97%B4%E4%BF%A1%E5%8F%B7%E5%88%86%E6%9E%90"><span class="nav-number">2.</span> <span class="nav-text">实验二离散时间信号分析</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Fitz"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Fitz</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">78</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">52</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/Starrynightzyq" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Starrynightzyq" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:starrynightzyq@gmail.com" title="E-Mail → mailto:starrynightzyq@gmail.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://space.bilibili.com/57711842" title="Bilibili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;57711842" rel="noopener" target="_blank"><i class="fa fa-fw fa-custom bilibili"></i>Bilibili</a>
      </span>
      <span class="links-of-author-item">
        <a href="http://wpa.qq.com/msgrd?v=3&uin=2421854978&site=qq&menu=yes" title="QQ → http:&#x2F;&#x2F;wpa.qq.com&#x2F;msgrd?v&#x3D;3&amp;uin&#x3D;2421854978&amp;site&#x3D;qq&amp;menu&#x3D;yes" rel="noopener" target="_blank"><i class="fa fa-fw fa-custom qq"></i>QQ</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://leiblog.wang/" title="http:&#x2F;&#x2F;leiblog.wang" rel="noopener" target="_blank">Lei Blog</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        
  <div class="beian"><a href="http://beian.miit.gov.cn/" rel="noopener" target="_blank">苏ICP备20042287号 </a>
  </div>

<div class="copyright">
  
  &copy; 2018 – 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Fitz</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    <span title="站点总字数">251k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:48</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v5.3.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://mist.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> v7.7.2
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-pjax@0/pjax.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>

  <script>
var pjax = new Pjax({
  selectors: [
    'head title',
    '#page-configurations',
    '.content-wrap',
    '.post-toc-wrap',
    '#pjax'
  ],
  switches: {
    '.post-toc-wrap': Pjax.switches.innerHTML
  },
  analytics: false,
  cacheBust: false,
  scrollTo : !CONFIG.bookmark.enable
});

window.addEventListener('pjax:success', () => {
  document.querySelectorAll('script[pjax], script#page-configurations, #pjax script').forEach(element => {
    var code = element.text || element.textContent || element.innerHTML || '';
    var parent = element.parentNode;
    parent.removeChild(element);
    var script = document.createElement('script');
    if (element.id) {
      script.id = element.id;
    }
    if (element.className) {
      script.className = element.className;
    }
    if (element.type) {
      script.type = element.type;
    }
    if (element.src) {
      script.src = element.src;
      // Force synchronous loading of peripheral JS.
      script.async = false;
    }
    if (element.getAttribute('pjax') !== null) {
      script.setAttribute('pjax', '');
    }
    if (code !== '') {
      script.appendChild(document.createTextNode(code));
    }
    parent.appendChild(script);
  });
  NexT.boot.refresh();
  // Define Motion Sequence & Bootstrap Motion.
  if (CONFIG.motion.enable) {
    NexT.motion.integrator
      .init()
      .add(NexT.motion.middleWares.subMenu)
      .add(NexT.motion.middleWares.postList)
      .bootstrap();
  }
  NexT.utils.updateSidebarPosition();
});
</script>




  




  
<script src="/js/local-search.js"></script>













    <div id="pjax">
  

  
      

<script>
  if (typeof MathJax === 'undefined') {
    window.MathJax = {
      loader: {
        source: {
          '[tex]/amsCd': '[tex]/amscd',
          '[tex]/AMScd': '[tex]/amscd'
        }
      },
      tex: {
        inlineMath: {'[+]': [['$', '$']]},
        tags: 'ams'
      },
      options: {
        renderActions: {
          findScript: [10, doc => {
            document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
              const display = !!node.type.match(/; *mode=display/);
              const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
              const text = document.createTextNode('');
              node.parentNode.replaceChild(text, node);
              math.start = {node: text, delim: '', n: 0};
              math.end = {node: text, delim: '', n: 0};
              doc.math.push(math);
            });
          }, '', false],
          insertedScript: [200, () => {
            document.querySelectorAll('mjx-container').forEach(node => {
              let target = node.parentNode;
              if (target.nodeName.toLowerCase() === 'li') {
                target.parentNode.classList.add('has-jax');
              }
            });
          }, '', false]
        }
      }
    };
    (function () {
      var script = document.createElement('script');
      script.src = '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
      script.defer = true;
      document.head.appendChild(script);
    })();
  } else {
    MathJax.startup.document.state(0);
    MathJax.texReset();
    MathJax.typeset();
  }
</script>

    

  

    </div>

  <!-- 页面点击小红心 -->
  <!-- <script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script> -->
  <script type="text/javascript" src="/js/clicklove.js"></script><!-- hexo-inject:begin --><!-- hexo-inject:end -->
</body>
</html>
